import Router from 'vue-router'
import Vue from 'vue'
import dataOverview from '../view/movies/dataOverview.vue'
import bigScreen from '../view/movies/bigScreen.vue'
import movieList from '../view/movies/movieList.vue'

Vue.use(Router)

// 防止跳转同一路径出异常
// const originalPush = Router.prototype.push
// Router.prototype.push = function push(location, onResolve, onReject) {
//     if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
//     return originalPush.call(this, location).catch(err => err)
// }

const router = new Router({
    mode: 'history', // 可以使用HTML5历史记录，去掉URL中的#
    routes: [
        {
            path: '/',
            name: 'dataOverview',
            component: dataOverview
        },
        // {
        //     path: '/dataOverview',
        //     name: 'dataOverview',
        //     component: dataOverview
        // },
		{ 
			path: '/bigScreen',
			name: 'bigScreen',
			component: bigScreen
		},
		{ 
			path: '/movieList',
			name: 'movieList',
			component: movieList
		}
    ]
})

export default router

